describe('practice-7-5', function () {

    it("每个人发到13张扑克牌",function(){
        var arr_result = get_auto_card();
        console.info(arr_result.length);
        for(var i = 0;i < arr_result.length; i ++)
        {
            expect((arr_result[i].S).length + (arr_result[i].H).length + (arr_result[i].D).length + (arr_result[i].C).length).toBe(13);
        }
    });
    it("每个花色的牌都是13张",function(){
        var arr_result = get_auto_card();
        console.info(arr_result.length);
        var count_S = 0;
        var count_H = 0;
        var count_D = 0;
        var count_C = 0;
        for(var i = 0;i < arr_result.length; i ++)
        {
            count_S = count_S + (arr_result[i].S).length;
            count_H = count_H + (arr_result[i].H).length;
            count_D = count_D + (arr_result[i].D).length;
            count_C = count_C + (arr_result[i].C).length;
        }
        expect(count_C).toBe(13);
        expect(count_D).toBe(13);
        expect(count_H).toBe(13);
        expect(count_S).toBe(13);
    });
    it("每个花色的这13张牌的值各不相同",function(){
        var arr_result = get_auto_card();

        var arr_spaces = [];
        var arr_hearts = [];
        var arr_diamonds = [];
        var arr_clubs = [];

        for(var n = 0; n < arr_result.length ; n ++)
        {
            arr_spaces = arr_spaces.concat(arr_result[n].S);
            arr_hearts = arr_hearts.concat(arr_result[n].H);
            arr_clubs = arr_clubs.concat(arr_result[n].C);
            arr_diamonds = arr_diamonds.concat(arr_result[n].D);
        }

        for(var i = 0; i < 13;i ++)
        {
            for(var j = 0; j < i; j ++)
            {
                expect(arr_clubs[i]!=arr_clubs[j]).toBe(true);
                expect(arr_spaces[i]!=arr_spaces[j]).toBe(true);
                expect(arr_hearts[i]!=arr_hearts[j]).toBe(true);
                expect(arr_diamonds[i]!=arr_diamonds[j]).toBe(true);
            }
        }
    });
});